/*
 * Created by JFormDesigner on Fri Oct 17 17:57:11 CST 2025
 */

package com.geek.javase.ch09;

import java.awt.*;
import java.awt.event.*;
import javax.swing.*;

/**
 * @author 27636
 */
public class MyFrame extends JFrame {

    public static void main(String[] args) {
        new MyFrame().setVisible(true);
    }
    public MyFrame() {
        this.setLocationRelativeTo(null);
        this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        initComponents();
    }

    private void login(ActionEvent e) {
        // TODO add your code here
        JOptionPane.showMessageDialog(null,"正在登录中...");
    }

    private void initComponents() {
        // JFormDesigner - Component initialization - DO NOT MODIFY  //GEN-BEGIN:initComponents  @formatter:off
        label1 = new JLabel();
        loginButton = new JButton();
        registerButton = new JButton();

        //======== this ========
        setTitle("\u9996\u9875");
        Container contentPane = getContentPane();
        contentPane.setLayout(null);

        //---- label1 ----
        label1.setText("\u767b\u5f55\u754c\u9762");
        label1.setHorizontalAlignment(SwingConstants.CENTER);
        contentPane.add(label1);
        label1.setBounds(new Rectangle(new Point(125, 30), label1.getPreferredSize()));

        //---- loginButton ----
        loginButton.setText("\u767b\u5f55");
        loginButton.addActionListener(e -> login(e));
        contentPane.add(loginButton);
        loginButton.setBounds(new Rectangle(new Point(40, 145), loginButton.getPreferredSize()));

        //---- registerButton ----
        registerButton.setText("\u6ce8\u518c");
        contentPane.add(registerButton);
        registerButton.setBounds(new Rectangle(new Point(185, 145), registerButton.getPreferredSize()));

        contentPane.setPreferredSize(new Dimension(295, 300));
        pack();
        setLocationRelativeTo(getOwner());
        // JFormDesigner - End of component initialization  //GEN-END:initComponents  @formatter:on
    }

    // JFormDesigner - Variables declaration - DO NOT MODIFY  //GEN-BEGIN:variables  @formatter:off
    private JLabel label1;
    private JButton loginButton;
    private JButton registerButton;
    // JFormDesigner - End of variables declaration  //GEN-END:variables  @formatter:on
}
